package com.cxyd.modules.wcs.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.wcs.dto.RouteSetDTO;
import com.cxyd.modules.wcs.service.RouteSetService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wcs/route-set")
public class RouteSetController {
    private final RouteSetService routeSetService;

    public RouteSetController(RouteSetService routeSetService) {
        this.routeSetService = routeSetService;
    }

    @GetMapping("page")
    @RequiresPermissions("wcs:route-set")
    public Result<PageData<RouteSetDTO>> page(@RequestParam Map<String, Object> params) {
        final PageData<RouteSetDTO> page = routeSetService.page(params);
        return new Result<PageData<RouteSetDTO>>().ok(page);
    }
}
